# !/usr/bin/env python
# -*- coding: utf-8 -*-
from model import Schema
from jinja2 import Environment
from util.code import render_schema


def init_schema(schema: Schema, env: Environment):
    # backend
    render_schema(env, schema, "node/server.j2", "out/server.js")

    # frontend
    render_schema(env, schema, "node/auth.j2", "out/util/auth.js")
    render_schema(env, schema, "node/request.j2", "out/util/request.js")
